{extend name="mainadmin@layouts/base" /}
{block name="main" }

<header class="header  b-b clearfix">
    <div class="page-breadcrumbs">
        <ul class="breadcrumb">
            <li>
                <i class="fa fa-ellipsis-v"></i>
                <strong>{$row['pay_id']>0?'编缉支付':'添加支付'}</strong>
            </li>
        </ul>
        <a class="text-muted pull-right m-r-tm m-t-md pointer" data-toggle="back" title="返回"><i class="fa fa-reply"></i></a>
    </div>
</header>
<form class="form-horizontal form-validate form_vbox" method="post" action="{:url('info')}">
    <section class="vbox">
        <section class="scrollable  wrapper w-f">
            <section class="panel panel-default">
                <div class="panel-body">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">支付方式：</label>
                        <div class="col-sm-10">
                            <span class="help-inline">{$row.pay_name}</span>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-2 control-label">接口类名：</label>
                        <div class="col-sm-10">
                            <span class="help-inline">{$row.pay_code}</span>
                        </div>
                    </div>

                    {volist name="row.def_config" id="prow"}
                    <div class="form-group">
                        <label class="col-sm-2 control-label">{$prow['label']}：</label>
                        <div class="col-sm-10">
                            {if condition="$prow['type'] == 'file'"}
                            <div class="controls ">
                                <img class="thumb_img" name="imagefile" src="{$row['pay_config'][$prow['name']]}"
                                     style="max-height: 100px;"/>
                                <input class="hide" type="text" name="pay_config[{$prow['name']}]"
                                       value="{$row['pay_config'][$prow['name']]}"/>
                                <button class="btn btn-default" type="button" data-toggle="selectimg"
                                        data-config="selectimg">选择图片
                                </button>
                                <div style="color:red;margin-top:0.5rem">(请上传500*500的图片)</div>
                            </div>
                            {elseif condition="$prow['type'] == 'select'"/}
                            <select name="pay_config[{$prow['name']}]">
                                {volist name="prow.option" id="val" key='k'}
                                <option value="{$index}" {$row[
                                'pay_config'][$prow['name']]==$index?'selected':''}>{$val}</option>
                                {/volist}
                            </select>
                            {elseif condition="$prow['type'] == 'checkbox'"/}
                            {volist name="prow.option" id="val" key='k'}
                            <label><input type="checkbox" name="pay_config[{$prow['name']}][]" {:in_array($val['value'],$row['pay_config']['support'])?'checked':''}
                                value="{$val.value}">{$val.name}</label>
                            {/volist}
                            {elseif condition="$prow['type'] == 'textarea'"/}
                            <textarea name="pay_config[{$prow['name']}]" {$prow['is_must']==1?'data-rule-required="true"':''}
                            style="width:80%; height:130px;">{$row['pay_config'][$prow['name']]}</textarea>
                            {else/}
                            <input type="text" class="input-xlarge" {$prow['is_must']==1?'data-rule-required="true"':''}
                            name="pay_config[{$prow['name']}]" value="{$row['pay_config'][$prow['name']]}"/>
                            {/if}
                            {if condition="$prow['is_must'] == 1"/}
                            <span class="maroon">*</span>
                            {/if}
                            {notempty name="$prow['tip']"/}
                            <span class="help-inline">{$prow['tip']|raw}</span>
                            {/notempty}
                        </div>
                    </div>
                    {/volist}

                    <div class="form-group">
                        <label class="col-sm-2 control-label">排序（升序）：</label>
                        <div class="col-sm-10">
                            <input name="sort_order" class="input-mini " value="0" type="text">
                            <span class="help-inline">数值越大排越前</span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">是否启用：</label>
                        <div class="col-sm-10">
                            <label class="radio-inline">
                                <input name="status" value="1" {$row['status']==1?'checked':''} type="radio">启用
                            </label>
                            <label class="radio-inline" title="买家在下单时将无法使用此支付方式进行付款">
                                <input name="status" value="0" {$row['status']==0?'checked':''} type="radio">不启用
                            </label>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">用于购买支付：</label>
                        <div class="col-sm-10">
                            <label class="radio-inline">
                                <input name="is_buy_pay" value="1" {$row['is_buy_pay']==1?'checked':''} type="radio">是
                            </label>
                            <label class="radio-inline">
                                <input name="is_buy_pay" value="0" {$row['is_buy_pay']==0?'checked':''}
                                type="radio">不是
                            </label>
                        </div>
                    </div>
                    <!--<div class="form-group">
                        <label class="col-sm-2 control-label">用于充值支付：</label>
                        <div class="col-sm-10">
                            <label class="radio-inline">
                                <input name="is_recharge" value="1" {$row['is_recharge']==1?'checked':''} type="radio">是
                            </label>
                            <label class="radio-inline">
                                <input name="is_recharge" value="0" {$row['is_recharge']==0?'checked':''}
                                type="radio">不是
                            </label>
                        </div>
                    </div>-->
                </div>
            </section>
        </section>
        <footer class="footer bg-white b-t p-t">
            <div class="form-group">
                <div class="col-sm-4 col-sm-offset-1">
                    <input name="pay_id" type="hidden" value="{$row.pay_id|intval}">
                    <button type="submit" class="btn btn-primary js_save_submit" data-loading-text="保存中...">保存</button>
                    <button type="button" class="btn btn-default" data-toggle="back">取消</button>
                </div>
            </div>
        </footer>
    </section>
</form>
{/block}
